import React, { Component } from 'react'
import {SoundOutlined} from "@ant-design/icons"
import {getNotice} from '@net/notice/index'

interface IProps { }
interface IStates {
    notice:any[]
 }

export default class QuickEntry extends Component<IProps, IStates>{
    constructor(props:IProps){
        super(props)
        this.state = {
            notice:[{notice:"暂无更新内容"}]
        }
    }
    public componentDidMount() {
        getNotice({page:1,pageSize:20},null).then((res:any) => {
            this.setState({notice:res.data.data.reverse()})
        })
    }
    public render() {
        return (
            <div className="crm-home-notice">
                <div className="crm-home-notice-header">
                    <div className="crm-home-notice-title">
                        <SoundOutlined style={{color:"#F5B486"}} />
                        <span>最新公告</span>
                    </div>
                    <div className="crm-home-notice-more">更多</div>
                </div>
                <div className="crm-home-notice-content">
                   {this.state.notice.map((item:any,i:number) => {
                       return (
                        <div className="crm-home-notice-item" key={i}>
                            {item.notice}
                            <span>{item.date}</span>
                        </div>
                       )
                   })}
               </div>
            </div>
        )
    }
}